Post

Replies

Boosts

Views

Activity

Reply to Trying to print NSAttributedString via many UITextViews causes crash
Ignore my previous post. Mine was caused by a work around to a crash bug that appears to have since been fixed, such that now the work around causes a similar crash. I wonder if perhaps your issue may have been caused by the same bug, and has since disappeared in more recent versions of the OS? The work around was this: ` override func drawPrintFormatter(_ printFormatter: UIPrintFormatter, forPageAt pageIndex: Int) { //  WORK AROUND A CRASH BUG WHEN THERE ARE MULTIPLE UIPrintFormatters and pages //  See:  https://forums.developer.apple.com/thread/30009 var index = pageIndex if let printFormatter = printFormatter as? UIViewPrintFormatter { index = pageIndex - printFormatter.startPage; } return super.drawPrintFormatter(printFormatter, forPageAt:index); } `
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’22
Reply to Trying to print NSAttributedString via many UITextViews causes crash
Did you ever resolve this? I'm having exactly the same problem, except that the index is different in my error: index 18446744073709551615 beyond bounds [0 .. 0] (Which I believe is -1 equivalent in an unsigned integer form.) My stack trace is identical to yours as far as I can tell. It actually displays the preview in the print panel, and then crashes. If I only attempt to print a single item it succeeds, but crashes when I try to print more than one item. However, if I print multiple items all on the one page (startingAtPage: 0 for all of them), it prints successfully and does NOT crash (but then of course all the items are printed overlapping on top of each other on a single page and looks terrible).
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’22
Reply to Unable to Add for Review - Xcode 15.0.1 - New apps and app updates must be built with the public (GM) versions of Xcode 11 or later
The app review team must be bored today.
Replies
Boosts
Views
Activity
Nov ’23
Reply to Unable to Add for Review - Xcode 15.0.1 - New apps and app updates must be built with the public (GM) versions of Xcode 11 or later
It's not the first time Apple has done this. Same issue was occurring for a while at least three years ago. Hopefully they'll fix it quickly this time.
Replies
Boosts
Views
Activity
Nov ’23
Reply to Remaining page rect after UIViewPrintFormatter added to UIPrintPageRenderer
(Humble apologies... I seem to have double-posted this question.)
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Trying to print NSAttributedString via many UITextViews causes crash
Ignore my previous post. Mine was caused by a work around to a crash bug that appears to have since been fixed, such that now the work around causes a similar crash. I wonder if perhaps your issue may have been caused by the same bug, and has since disappeared in more recent versions of the OS? The work around was this: ` override func drawPrintFormatter(_ printFormatter: UIPrintFormatter, forPageAt pageIndex: Int) { //  WORK AROUND A CRASH BUG WHEN THERE ARE MULTIPLE UIPrintFormatters and pages //  See:  https://forums.developer.apple.com/thread/30009 var index = pageIndex if let printFormatter = printFormatter as? UIViewPrintFormatter { index = pageIndex - printFormatter.startPage; } return super.drawPrintFormatter(printFormatter, forPageAt:index); } `
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Trying to print NSAttributedString via many UITextViews causes crash
Did you ever resolve this? I'm having exactly the same problem, except that the index is different in my error: index 18446744073709551615 beyond bounds [0 .. 0] (Which I believe is -1 equivalent in an unsigned integer form.) My stack trace is identical to yours as far as I can tell. It actually displays the preview in the print panel, and then crashes. If I only attempt to print a single item it succeeds, but crashes when I try to print more than one item. However, if I print multiple items all on the one page (startingAtPage: 0 for all of them), it prints successfully and does NOT crash (but then of course all the items are printed overlapping on top of each other on a single page and looks terrible).
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’22